package com.sinosoft.controller;

import com.sinosoft.pojo.ImageCategory;
import com.sinosoft.repository.ImageCategoryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PhotoListController {

    private final ImageCategoryRepository imageCategoryRepository;

    @Autowired
    public PhotoListController(ImageCategoryRepository imageCategoryRepository) {
        this.imageCategoryRepository = imageCategoryRepository;
    }

    @GetMapping(value = "getimgcategory")
    public List<ImageCategory> getImgCategory() {

        return imageCategoryRepository.findAll();
    }

}
